package com.cd.sendRequest.jpa.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * @Description:用于记录用户cookie信息
 * @Author: lqq
 * @Date: 2020/1/17 11:04
 */
@Data
@Entity
@Table(name = "db_cookie_store",
        indexes = {
                @Index(name = "idx_owner_id", columnList = "owner_id") // 添加索引优化查询性能
        })
@NoArgsConstructor
@AllArgsConstructor
public class CookieStore {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    //用户名
    @Column(name = "username",length = 50, columnDefinition = "VARCHAR(50)")
    private String username;

    //平台
    @Column(name = "platform",length = 20, columnDefinition = "VARCHAR(20)")
    private String platform;

    //cookie
    @Column(name = "cookie",length = 6000, columnDefinition = "VARCHAR(6000)")
    private String cookie;

    //owner_id
    @Column(name = "owner_id",length = 8,columnDefinition = "BIGINT(8)")
    private Long ownerId;

    //usage_type
    @Column(name = "usage_type",length = 20,columnDefinition = "VARCHAR(20)")
    private String usageType;
}
